package com.ajie.bluetoothcard.pre;

import com.ajie.bluetoothcard.ui.CardApplication;

import android.content.Context;
import android.content.SharedPreferences;


public class Preference {
	private Context mContext;
	SharedPreferences mSharedPreferences;
	
	public Preference(Context context){
		mContext = context;
		mSharedPreferences = mContext.getSharedPreferences("settings", Context.MODE_PRIVATE);
	}
	
	private static Preference instance;
	
	public static Preference getInstance(){
		if(instance == null){
			instance = new Preference(CardApplication.getEcgContext());
		}
		return instance;
	}

	

	
	// 是否是第一次插入------------------------
	
		public	final static String FIRST_INSERT = "FIRST_INSERT";
		public  boolean  isFirst_insert = true;
		
		public boolean getIsFirst_insert() {
			return mSharedPreferences.getBoolean(FIRST_INSERT, isFirst_insert);
		}
		
		public void setFIRST_INSERT(boolean isFirst_insert) {
			mSharedPreferences.edit().putBoolean(FIRST_INSERT, isFirst_insert).commit();
		}
		
		// 是否是第一次插入------------------------
		
		public	final static String FIRST_INSERT_BOX = "FIRST_INSERT_BOX";
		public  boolean  isFirst_insert_box = true;
		
		public boolean getIsFirst_insert_box() {
			return mSharedPreferences.getBoolean(FIRST_INSERT_BOX, isFirst_insert_box);
		}
		
		public void setFirst_insert_box(boolean isFirst_insert_box) {
			mSharedPreferences.edit().putBoolean(FIRST_INSERT_BOX, isFirst_insert_box).commit();
		}
		
		// 是否是第一次插入------------------------
		
		public	final static String SHOW_ADD_TYPE = "SHOW_ADD_TYPE";
		public  int  add_type_index = 5;
		
		public int getAdd_type_index() {
			return mSharedPreferences.getInt(SHOW_ADD_TYPE, add_type_index);
		}

		public void setAdd_type_index(int add_type_index_number) {
			mSharedPreferences.edit().putInt(SHOW_ADD_TYPE, add_type_index_number).commit();
		}

}
